<!--Author: W3layouts
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE HTML>
<html lang="zxx">

<head>
    <title>快点名教师登录</title>
    <!-- Meta tag Keywords -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="keywords"
          content="Simple Signin Form Responsive Widget,Login form widgets, Sign up Web forms , Login signup Responsive web form,Flat Pricing table,Flat Drop downs,Registration Forms,News letter Forms,Elements"
    />
    <link rel="stylesheet" href="/css/loginstyle.css" type="text/css" media="all"/>
    <!-- Style-CSS -->
    <link rel="stylesheet" href="/css/font-awesome.css">
    <script type="text/javascript" src="/js/pupop.js"></script>
    <script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script>
        function success(msg) {
            pupopTip('200px', '120px', '&nbsp;' + msg);
        }
        function lose(msg) {
            pupopTip('200px', '120px', '&nbsp;' + msg);
        }
        function lose_1() {
            pupopTip('200px', '120px', '&nbsp;&nbsp;&nbsp;&nbsp;登录失败<br>您输入的账号或密码错误');
        }
    </script>

    <script>
        function login() {
            var teacher_account = $('#account').val();
            var teacher_password = $('#password').val();
            console.log(teacher_account);
            console.log(teacher_password);

            $.ajax({
                type: "POST",
                url: "/loginsub",
                dataType: 'json',
                data: {
                    'teacherAccount': teacher_account,
                    'teacherPassword': teacher_password
                },

                success: function (result) {
                    var msg = result.msg;
                    console.log(result.code);
                    if (result.code == 1 || result.code == '1' ) {
                        lose(msg);
                        $(document).bind("click", function (e) {
                            $('div').closest('.pupopBox').each(function () {
                                if (e.target == this) {
                                    $(this).remove();
                                }
                            });
                        });
                    } else {
                        window.location.href = "/index";
                    }
                },
//                error: function (data) {
//                    var msg = data.msg;
//                    lose(msg);
//                    $(document).bind("click", function (e) {
//                        $('div').closest('.pupopBox').each(function () {
//                            if (e.target == this) {
//                                $(this).remove();
//                            }
//                        });
//                    })
//
//                }

            })
        }
    </script>

</head>

<body>

<div class="header-w3l">
    <h1>
        快<span>点</span>名<span>系</span>统<span>登</span>录
    </h1>
</div>

<div class="main-content-agile">
    <div class="sub-main-w3">
        <h2>Sign In Now</h2>



            <label>UserAccount</label>
            <div class="pom-agile">
                <span class="fa fa-user-o" aria-hidden="true"></span>
                <input id="account" placeholder="Account" name="account" class="user" type="text" required="">
            </div>

            <label>Password</label>
            <div class="pom-agile">
                <span class="fa fa-key" aria-hidden="true"></span>
                <input id="password" placeholder="Password" name="Password" class="pass" type="password" required="">
            </div>

            <div class="sub-w3l">
                <div class="sub-agile">
                    <input type="checkbox" id="brand1" value="">
                    <label for="brand1">
                        <span></span>Keep me Signed in</label>
                </div>

                <a href="/register">教师注册</a>
                <div class="clear"></div>
            </div>


            <div class="right-w3l">
                <input type="submit" value="Login" onclick="login()">
            </div>
    </div>
</div>

<div class="footer">
    <p>&copy; 2018 Simple Signin Form. All rights reserved | Design by
        <a href="">QuickSignIn</a>
    </p>
</div>

</body>

</html>